<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
/**
 * Undocumented class
 *  搜素记录
 * @name：zf
 */
class Seach extends Model
{
    use HasFactory;
    use HasFactory;
    use HasFactory;
    use SoftDeletes;
    protected $table='zfm_search';
    protected $guarded = [];
    /**
     * 搜索信息展示
     * @return mixed
     */
    public static function list(){
        return self::paginate(10);
    }
    /**
     * 搜索标签展示
     * @return mixed
     */
    public static function LabelList(){
        return self::with('Tags')->paginate(5);
    }
    /**
     * 搜索信息查找
     * @param $where
     * @return mixed
     */
    public static function Seek($field,$where){
        return self::where($field,'like',"%$where%")->get();
    }
    /**
     * 搜索信息删除
     */
    public static function del($id,$fangId){
        return self::where([$id=>$fangId])
            ->delete();
    }

}
